package com.wispx.gateway.common.exception;

import com.wispx.gateway.common.enums.ResponseCode;
import lombok.Getter;

import java.io.Serial;

/**
 * 连接异常，连接下游服务实例时发生的异常
 */
@Getter
public class ConnectException extends GatewayException {

    @Serial
    static final long serialVersionUID = -7034897190745766939L;
    private final String instanceId;
    private final String requestUri;

    public ConnectException(String instanceId, String requestUri) {
        this.instanceId = instanceId;
        this.requestUri = requestUri;
    }

    public ConnectException(String message, Throwable cause, ResponseCode code, String instanceId, String requestUri) {
        super(message, cause, code);
        this.instanceId = instanceId;
        this.requestUri = requestUri;
    }
}
